package com.ccm.demo.activemq.listener;

import com.alibaba.fastjson.JSON;
import com.ccm.demo.activemq.entity.User;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class ActiveMQListener {

	@JmsListener(destination = "myDestination")
	public void receiveMessage(String json){
		System.out.println(json);
		User user = JSON.parseObject(json, User.class);
		System.out.println(user);
	}
}
